package com.pc.cloud.services;

import org.apache.lucene.search.Query;
import org.apache.lucene.search.SortField;

import java.util.ArrayList;
import java.util.List;

public abstract class SearchArgs {
	public static final String MULTI_VALUE_FLAG = "multi_";

	/**
	 * Search Type
	 * 
	 * @return
	 */
	public abstract String getSearchType();

	public abstract QueryBuilder getQueryBuilder();

	private int initialRecord; // start
	private int fetchCount = 20; // default 20 //number

	// facet search
	private List<String> facetFields = new ArrayList<String>();
	private List<Query> facetQuery = new ArrayList<Query>();

	// sort
	private SortField[] sortFields;

	// summary
	private List<MetricArg> metricFields = new ArrayList<MetricArg>();
	private List<FacetQueryArg> facetQueryFields = new ArrayList<FacetQueryArg>();

	// retrivalValue
	private String valueField;

	public String getValueField() {
		return valueField;
	}

	public void setValueField(String valueField) {
		this.valueField = valueField;
	}

	public List<MetricArg> getMetricFields() {
		return metricFields;
	}

	public void setMetricFields(List<MetricArg> metricFields) {
		this.metricFields = metricFields;
	}

	public List<FacetQueryArg> getFacetQueryFields() {
		return facetQueryFields;
	}

	public void setFacetQueryFields(List<FacetQueryArg> facetQueryFields) {
		this.facetQueryFields = facetQueryFields;
	}

	public List<Query> getFacetQuery() {
		return facetQuery;
	}

	public List<String> getFacetFields() {
		return facetFields;
	}

	public int getFetchCount() {
		return fetchCount;
	}

	public void setFetchCount(int fetchCount) {
		this.fetchCount = fetchCount;
	}

	public int getInitialRecord() {
		return initialRecord;
	}

	public void setInitialRecord(int initialRecord) {
		this.initialRecord = initialRecord;
	}

	public void setFromPath(int page) {
		this.initialRecord = page;
	}

	public int getStartFrom() {
		return this.initialRecord;
	}

	public SortField[] getSortFields() {
		return sortFields;
	}

	public void setSortFields(SortField[] sortFields) {
		this.sortFields = sortFields;
	}
}
